[CMake] Add UTF8PROC_NO_INSTALL option (#152)
authorpast-due <30942300+past-due@users.noreply.github.com>
Wed, 17 Apr 2019 18:49:04 +0000 (14:49 -0400)
committerSteven G. Johnson <stevenj@mit.edu>
Wed, 17 Apr 2019 18:49:04 +0000 (14:49 -0400)
* [CMake] Add UTF8PROC_NO_INSTALL option

* change to UTF8PROC_INSTALL

CMakeLists.txt

index d2af3761847244e80ea2bec68f81652bd5df2a8d..c5deb7b69fc9add88475ee63478c5564d40ba3f7 100644 (file)
@@ -13,6 +13,8 @@ set(SO_MAJOR 2)
 set(SO_MINOR 2)
 set(SO_PATCH 0)
 
+option(UTF8PROC_INSTALL "Enable installation of utf8proc" On)
+
 add_library (utf8proc
   utf8proc.c
   utf8proc.h
@@ -46,12 +48,14 @@ set_target_properties (utf8proc PROPERTIES
   SOVERSION ${SO_MAJOR}
 )
 
-install(TARGETS utf8proc
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib)
+if (UTF8PROC_INSTALL)
+  install(TARGETS utf8proc
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib)
 
-install(
-  FILES
-    "${PROJECT_SOURCE_DIR}/utf8proc.h"
-  DESTINATION include)
+  install(
+    FILES
+      "${PROJECT_SOURCE_DIR}/utf8proc.h"
+    DESTINATION include)
+endif()